Part Number Hot Search : 
MM1027 7812A TK61023 330M1 TDA7448 UD50N0 MX7576J CONTROLS
Product Description
Full Text Search
 

To Download HD6413001 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  regarding the change of names mentioned in the document, such as hitachi electric and hitachi xx, to renesas technology corp. the semiconductor operations of mitsubishi electric and hitachi were transferred to renesas technology corporation on april 1st 2003. these operations include microcomputer, logic, analog and discrete devices, and memory chips other than drams (flash memory, srams etc.) accordingly, although hitachi, hitachi, ltd., hitachi semiconductors, and other hitachi brand names are mentioned in the document, these names have in fact all been changed to renesas technology corp. thank you for your understanding. except for our corporate trademark, logo and corporate statement, no changes whatsoever have been made to the contents of the document, and these changes do not constitute any alteration to the contents of the document itself. renesas technology home page: http://www.renesas.com renesas technology corp. customer support dept. april 1, 2003 to all our customers
cautions keep safety first in your circuit designs! 1. renesas technology corporation puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. trouble with semiconductors may lead to personal injury, fire or property damage. remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap. notes regarding these materials 1. these materials are intended as a reference to assist our customers in the selection of the renesas technology corporation product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to renesas technology corporation or a third party. 2. renesas technology corporation assumes no responsibility for any damage, or infringement of any third-party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials. 3. all information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by renesas technology corporation without notice due to product improvements or other reasons. it is therefore recommended that customers contact renesas technology corporation or an authorized renesas technology corporation product distributor for the latest product information before purchasing a product listed herein. the information described here may contain technical inaccuracies or typographical errors. renesas technology corporation assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. please also pay attention to information published by renesas technology corporation by various means, including the renesas technology corporation semiconductor home page (http://www.renesas.com). 4. when using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. renesas technology corporation assumes no responsibility for any damage, liability or other loss resulting from the information contained herein. 5. renesas technology corporation semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. please contact renesas technology corporation or an authorized renesas technology corporation product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. 6. the prior written approval of renesas technology corporation is n ecessary to reprint or reproduce in whole or in part these materials. 7. if these products or technologies are subject to the japanese export control restrictions, they must be exported under a license from the japanese government and cannot be imported into a country other than the approved destination. any diversion or reexport contrary to the export control laws and regulations of japan and/or the country of destination is prohibited. 8. please contact renesas technology corporation for further details on these materials or the products contained therein.
hitachi microcomputer development environment system high-performance embedded w o rkshop 2 (for windows ? 98/me, windows nt ? 4.0 , windows ? 2000 and windows ? xp) hew debugger users manual ade-702-284a rev. 2.0 06/03/02 hitachi, ltd.
cautions 1. hitachi neither warrants nor grants licenses of any rights of hitachis or any third partys patent, copyright, trademark, or other intellectual property rights for information contained in this document. hitachi bears no responsibility for problems that may arise with third partys rights, including intellectual property rights, in connection with use of the information contained in this document. 2. products and product specifications may be subject to change without notice. confirm that you have received the latest product standards or specifications before final design, purchase or use. 3. hitachi makes every attempt to ensure that its products are of high quality and reliability. however, contact hitachis sales office before using the product in an application that demands especially high quality and reliability or where its failure or malfunction may directly threaten human life or cause risk of bodily injury, such as aerospace, aeronautics, nuclear power, combustion control, transportation, traffic, safety equipment or medical equipment for life support. 4. design your application so that the product is used within the ranges guaranteed by hitachi particularly for maximum rating, operating supply voltage range, heat radiation characteristics, installation conditions and other characteristics. hitachi bears no responsibility for failure or damage when used beyond the guaranteed ranges. even within the guaranteed ranges, consider normally foreseeable failure rates or failure modes in semiconductor devices and employ systemic measures such as fail-safes, so that the equipment incorporating hitachi product does not cause bodily injury, fire or other consequential damage due to operation of the hitachi product. 5. this product is not designed to be radiation resistant. 6. no one is permitted to reproduce or duplicate, in any form, the whole or part of this document without written approval from hitachi. 7. contact hitachis sales office for any questions regarding this document or hitachi semiconductor products.
trademarks microsoft, ms-dos, windows, windows nt are registered trademarks of microsoft corporation. visual sourcesafe is a trademark of microsoft corporation. ibm is a registered trademark of international business machines corporation. all brand or product names used in this manual are trademarks or registered trademarks of their respective companies or organizations. document information product code: s32hewm version: 2.1 copyright ? hitachi micro systems europe ltd. 2001. all rights reserved. copyright ? hitachi, ltd. 2001. all rights reserved.
about this manual this manual describes how to use the hitachi embedded workshop and the debugger functionality. it covers all aspects of the debug process from creating your debug workspace, loading the download modules and running your program. for information on the look and feel of the hitachi embedded workshop or customizing the hew environment please refer to the main hew user manual. document conventions this manual uses the following typographic conventions: table 1 typographic conventions convention meaning [menu->menu option] bold text with -> is used to indicate menu options (for example, [file->save as...] ). filename.c uppercase names are used to indicate filenames. enter this string used to indicate text that must be entered (excluding the quotes). key + key used to indicate required key presses. for example, ctrl+n means press the ctrl key and then, whilst holding the ctrl key down, press the n key. (the how to symbol) when this symbol is used, it is always located in the left hand margin. it indicates that the text to its immediate right is describing how to do something.
rev. 2.0, 06/02, i contents cautions.......................................................................................................................................... iii 1. overview ................................................................................................. 1 1.1 workspaces, projects and files .......................................................................................... 1 1.2 launching the hew ........................................................................................................... 2 1.3 creating a new workspace ................................................................................................ 3 1.4 opening a workspace ......................................................................................................... 4 1.5 saving a workspace............................................................................................................ 5 1.6 closing a workspace ......................................................................................................... .5 1.7 using old workspaces ....................................................................................................... 5 1.8 exiting the hew................................................................................................................. 5 1.9 debugger sessions .............................................................................................................. 6 1.10 selecting a session.............................................................................................................. 7 1.10.1 adding and deleting sessions............................................................................... 8 1.10.2 saving session information ................................................................................... 10 2. preparing to debug .................................................................................. 11 2.1 compiling for debug ......................................................................................................... .11 2.2 selecting a debugging platform......................................................................................... 11 2.3 configuring the debugging platform ................................................................................. 13 2.3.1 mapping ................................................................................................................. 14 2.3.2 memory resource.................................................................................................. 15 2.3.3 downloading a program........................................................................................ 16 2.3.4 manual download of modules.............................................................................. 18 2.3.5 automatic download of modules ......................................................................... 18 2.3.6 unload modules ..................................................................................................... 19 2.3.7 looking at registers.............................................................................................. 20 2.3.8 expanding a bit register....................................................................................... 20 2.3.9 modifying register contents ................................................................................ 21 2.3.10 using register contents ........................................................................................ 22 3. looking at your program ........................................................................ 23 3.1 viewing the code................................................................................................................ 23 3.2 viewing assembly-language code................................................................................... 23 3.3 modifying assembly-language code ............................................................................... 24 3.4 looking at labels................................................................................................................ 25 3.5 listing labels...................................................................................................................... 25 3.6 looking at a specific address............................................................................................ 26 3.7 looking at the current program counter address............................................................. 26 3.8 source address column ....................................................................................................... 26 3.9 debugger columns .............................................................................................................. 28 4. working with memory ............................................................................ 29 4.1 looking at an area of memory .......................................................................................... 29 4.2 displaying data in different formats ................................................................................ 30 4.3 looking at a different area of memory ............................................................................ 30 4.4 modifying memory contents ............................................................................................. 31 4.4.1 selecting a memory range ................................................................................... 31 4.4.2 finding a value in memory .................................................................................. 31 4.5 filling an area of memory with a value ........................................................................... 32 4.5.1 filling a range....................................................................................................... 32
rev. 2.0, 06/02, ii 4.6 copying an area of memory ...............................................................................................33 4.7 testing an area of memory.................................................................................................33 4.8 saving and verifying an area of memory ..........................................................................34 4.9 looking at i/o memory ....................................................................................................... 34 4.9.1 opening an io window..........................................................................................35 4.9.2 expanding an i/o register display........................................................................35 4.9.3 modifying i/o register contents...........................................................................35 5. executing your program .......................................................................... 37 5.1 running from reset .............................................................................................................37 5.2 continuing run ....................................................................................................................37 5.3 running to the cursor ..........................................................................................................37 5.4 single step ...........................................................................................................................37 5.4.1 stepping into a function ........................................................................................38 5.4.2 stepping over a function call ...............................................................................38 5.4.3 stepping out of a function ....................................................................................38 5.5 multiple steps ......................................................................................................................39 6. stopping your program............................................................................ 41 6.1 halting execution ................................................................................................................41 6.2 standard breakpoints (pc breakpoints)..............................................................................41 6.2.1 using the breakpoint dialog box ..........................................................................42 6.2.2 toggling pc breakpoints .......................................................................................42 7. elf/dwarf2 support .................................................................................. 43 7.1 c/c++ operators..................................................................................................................43 7.2 c/c++ expressions ..............................................................................................................43 7.3 supporting duplicate labels ...............................................................................................44 7.4 selecting a function.............................................................................................................44 7.5 deselecting a function.........................................................................................................44 7.6 setting a function ................................................................................................................45 7.7 overlay function .................................................................................................................45 7.8 displaying section group.................................................................................................... 45 7.9 tooltip watch ......................................................................................................................46 7.10 local variables ....................................................................................................................47 7.11 watch items .........................................................................................................................48 7.11.1 adding a watch ......................................................................................................48 7.11.2 expanding a watch.................................................................................................48 7.11.3 editing a watch item's value.................................................................................49 8. viewing the profile information............................................................... 51 8.1 stack information files........................................................................................................51 8.2 profile information files......................................................................................................52 8.3 loading stack information files .........................................................................................53 8.4 enabling the profile .............................................................................................................54 8.5 specifying the measurement for profiling...........................................................................54 8.6 executing the program and checking the results ..............................................................54 8.6.1 list tab ...................................................................................................................54 8.6.2 tree tab .................................................................................................................. 54 8.6.3 profile-chart window ............................................................................................55 8.7 types and purposes of displayed data ...............................................................................55 8.8 creating profile information files.......................................................................................57 8.9 notes.....................................................................................................................................57
rev. 2.0, 06/02, iii appendix a - i/o file format .......................................................................... 59 a.1 file format........................................................................................................................... 59 appendix b - symbol file format.................................................................... 61
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 1 of 61 1. overview this chapter describes the fundamental concepts of the hitachi embedded workshop. it is intended to give users who are new to windows? extra help, filling in the details that are required by later chapters. 1.1 workspaces, projects and files just as a word processor allows you to create and modify documents, the hitachi embedded workshop allows you to create and modify workspaces. a workspace can be thought of as a container of projects and, similarly, a project can be though of as a container of project files. thus, each workspace contains one or more projects and each project contains one or more files. figure 1.1 illustrates this graphically. project project project file file file workspace figure 1.1: workspaces, projects and files workspaces allow you to group related projects together. for example, you may have an application that needs to be built for different processors or you may be developing an application and library at the same time. projects can also be linked hierarchically within a workspace, which means that when one project is built all of its child projects are built first. however, workspaces on their own are not very useful, we need to add a project to a workspace and then add files to that project before we can actually do anything.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 2 of 61 1.2 launching the hew to run the hew, open the start menu of windows?, select programs, select hitachi embedded workshop 2 and then select the shortcut of the hitachi embedded workshop. by default, the welcome! dialog shown in figure 1.2 will be displayed. figure 1.2: welcome! dialog to create a new workspace, select the create a new project workspace button, and click the ok button. to open one of recent project workspaces, select the open a recent project workspace button, select a workspace from the drop-down list, and click the ok button. the recent project workspace list displays the same information as that seen in the workspace most recently used file list. this list appears on the file menu. to open a workspace by specifying a workspace file (.hws file), select the browse to another project workspace button, and click the ok button. to register a tool to or unregister a tool from the hew, click the administration button. click the cancel button to use the hew without opening a workspace.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 3 of 61 1.3 creating a new workspace to create a new workspace: 1. select the create a new project workspace option from the welcome! dialog (figure 1.2) and press the ok button or select [file->new workspace...] . the new project workspace dialog will be displayed (figure 1.3). figure 1.3: new project workspace dialog 2. enter the name of the new workspace into the workspace name field. this can be up to 32 characters in length and contain letters, numbers and the underscore character. as you enter the workspace name the hew will add a subdirectory and project name for you automatically. this can be changed if desired. use the browse button to graphically select the directory in which you would like to create the workspace. alternatively, you can type the directory into the directory field manually. this allows the workspace and project name to be different. 3. select the cpu family and tool chain upon which you would like to base the workspace. note that this cannot be changed once the workspace has been created. 4. when a new workspace is created, hew will also create a project with the name specified in the project name field and place it inside the new workspace automatically. the project types list displays all of the available project types (e.g. application, library etc.). select the type of project that you want to create from this list. the project types displayed will be all valid types for the current cpu family and tool chain pair. the project types are classified in three classes: tool chains only, debugger only or full project generator that configures both the debugger and tool chain aspect of hew. 5. click the ok button to create the new workspace and project. note: it is not possible to create a workspace if one already exists in the same directory.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 4 of 61 1.4 opening a workspace to open a workspace: 1. select browse to another project workspace option from the welcome! dialog (figure 1.2) and press the ok button or select [file->open workspace] . the open project workspace dialog will be invoked. 2. select the workspace file that you want to open (.hws files only). 3. click the open button to open the workspace. if the hew is set-up to display information when a workspace is opened then a workspace properties dialog will be invoked (figure 1.4). otherwise, the workspace will be opened. note that whether the workspace properties dialog is shown depends on the setting of either the show workspace information on workspace open check box on the workspace properties dialog or the display workspace information dialog on opening workspace check box on the workspace tab of the tools options dialog. click the ok button to open the workspace. click the cancel button to stop opening the workspace. figure 1.4: workspace properties dialog the hitachi embedded workshop keeps track of the last five workspaces that you have opened and adds them to the file menu under the recent workspaces sub-menu. this gives you a shortcut to opening workspaces, which you have used recently.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 5 of 61 to open a recently used workspace: 1. select open a recent project workspace from the welcome! dialog, select the name of the workspace from the drop down list and then click the ok button. or: 2. select [file->recent workspaces] and from this sub-menu select the name of the workspace. note: the hitachi embedded workshop only permits one workspace to be open at a time. consequently, if you attempt to open a second workspace, the first will be closed before the new one is opened. 1.5 saving a workspace selecting [file-> save workspace] can save a hew workspace. 1.6 closing a workspace selecting [file-> close workspace] can close a hew workspace. if there are any outstanding changes to the workspace or any of its projects you will be requested whether or not you wish to save them. selecting [file-> save workspace] can save a hew workspace. 1.7 using old workspaces the hew can open any workspace that was created on a previous version of the hew. this should not cause any problems and any differences in the workspace file details should be upgraded on the open. a back-up version of the initial workspace or project file should have been saved in the current directory of the file that is being upgraded. no upgrade path is available for session files used in the hitachi debugging interface. 1.8 exiting the hew the hew can be exited by selecting [file->exit] , pressing the alt+f4 accelerator or by selecting the close option from the system menu. (to open the system menu, click the icon at the upper-left corner of the hew title bar.) if a workspace is open then the same workspace closedown procedure is followed as described in the previous section.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 6 of 61 1.9 debugger sessions the hew allows you to store all of your builder options into a configuration. this means that you can freeze all of the options and give them a name. in a similar way hew allows you to store your debugger options in a session. later on, you can select the session and all of the debugger options will be restored. these sessions allow the user to specify target, download modules and debug options. this means that potentially each session can be targeted at a different end platform. this facility can allow you to have many different sessions each with different debugger options defined. for example it is possible to have each session using the same target but with slight variations in the session options. this can mean it is very easy for you to switch session and modify such things as register values or target settings such as clock speed. for example 2 sessions named session1 and session 2 both share the same target but the sessions can be subtlety different with regard to the options defined. this means that both sessions can share the same download module and avoid unnecessary code rebuilds. this is because sessions are not directly related to the build configuration data. each sessions data is stored in a separate file to the hew project. you can then manipulate the data to share or modify as is required in the project. this is described further below:
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 7 of 61 1.10 selecting a session the current session can be set in two ways. to select a session: either: 1. select it from the drop down list box (figure 1.5) in the toolbar. figure 1.5: toolbar selection or: 1. select [options->debug sessions] . this will invoke the debug sessions dialog box (figure 1.6). figure 1.6: debug sessions dialog 2. select the session that you want to use from the current session drop down list. 3. click ok to set the session.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 8 of 61 1.10.1 adding and deleting sessions you can add a new session by copying settings from another session or deleting a session. these three tasks are described below. to add a new empty session: 1. select [options->debug sessions] to display the debug sessions dialog box (figure 1.6). 2. click the add button. the add session dialog box will be invoked (figure 1.7). 3. click the add new session radio button. 4. enter a name for the session. 5. click ok to close the debug sessions dialog box. 6. this operation creates a new empty session in the project directory. it uses the session name as its new file name. if the file name already exists an error is displayed. figure 1.7: add new sessions dialog to import a link to an existing session file: 1. select [options->debug sessions] to display the debug sessions dialog box (figure 1.6). 2. click the add button. the add new session dialog box will be invoked (figure 1.7). 3. click the use an existing session file radio button. 4. enter a name for the session. 5. browse to an existing session file location, which you would like to import into the current project. 6. click the open and maintain link to session file check box. this means the session will not be imported into the project directory but instead the hew will link to the session location 7. click ok to close the debug sessions dialog box.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 9 of 61 to remove a session: 1. select [options->debug sessions] to display the debug sessions dialog box (figure 1.6). 2. select the session you would like to modify. 3. click the remove button. 4. note it is not possible to remove the current session. 5. click ok to close the debug sessions dialog box. to view the session properties: 1. select [options->debug sessions] to display the debug sessions dialog box (figure 1.6). 2. select the session you would like to view the properties for. 3. click the properties button. the properties dialog is displayed. (figure 1.8). 4. click ok to close the debug sessions dialog box. figure 1.8: session properties dialog to make a session read only: 1. select [options->debug sessions] to display the debug sessions dialog box (figure 1.6). 2. select the session you would like to view the properties for. 3. click the properties button. the properties dialog is displayed. (figure 1.8). 4. click the read only check box. this makes the link read only. this is useful if you are sharing debugger- setting files and you do not want data to be modified accidentally. 5. click ok. to save a session as a different name: 1. select [options->debug sessions] to display the debug sessions dialog box (figure 1.7). 2. select the session you would like to save. 3. click the save as button. the save as dialog is displayed. (figure 1.9). 4. browse to the new file location. 5. if you only want to export the session file to another location then leave the maintain link checkbox unchecked. if you would like hew to use this location instead of the current session location then check the maintain link check box. 6. click ok.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 10 of 61 figure 1.10: save session dialog 1.10.2 saving session information to save a session: 1. select the [file->save session] .
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 11 of 61 2. preparing to debug this section of the manual describes all the facilities that are available in the debugger for setting up the target platform to start debugging your program. you will learn how to select and configure a debugging platform with which to debug, and how to load your debug object file. 2.1 compiling for debug in order to be able to debug your program at c/c++ source level, your c/c++ program must be compiled and linked with the debug option enabled. when this option is enabled, the compiler puts all the information necessary for debugging your c/c++ code into the absolute file or management information file, which are then usually called debug object files . when you create your project the initial setup will normally configure for debug. note make sure you have the debug option enabled on your compiler and linker, when you generate an object file for debugging. if your debug object file does not contain any debugging information (for example, the s-record format), then you can still load it into the debugging platform, but you will only be able to debug at the assembly-language level. 2.2 selecting a debugging platform selecting the debugging platform is very dependent on the installation of the hew. if the hew has a toolchain installed then the application project generator will be able to setup both the toolchain and the debugger targets simultaneously. this allows the options for targets and toolchain to be matched closely so no inconsistencies occur. if there is no toolchain installed you will be only be able to select debug only project types. by default hew will display a debug only project generation type for each cpu family in the new workspace dialog. this project type will provide similar behavior to the previous hdi session dialog box.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 12 of 61 figure 2.1: new workspace dialog the dialog in figure 2.1 allows you to select a project type for generation, which matches your cpu target. to create a debug only project using the standard debug project type: 1. select [file->new workspace] . the dialog shown in figure2.1 is displayed. 2. select the debug only project type and click the ok button. 3. the debug only project wizard is displayed. the dialog shown in figure 2.2 is displayed. 4. it allows the user to select the specific target for his debug project. this is dependent on the selection made in the new workspace dialog. this page displays all valid debugger targets that are currently installed. the user can choose which platforms will be used for debugging in this new debug project. it is possible to select one or more targets and a debugger session will be created for each target. 5. click the finish button to compete the project creation process. a summary dialog will be displayed. once completed the debugger project generator should create a project, which sets up the debug options correctly for each debugger session. the generator also creates a default configuration.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 13 of 61 figure 2.2: new project dialog figure 2.3: summary dialog 2.3 configuring the debugging platform before you can load a program into your debugging platform you must set it up to match your application's system. the items that must be set-up are typically device type, operating mode, clock speed and the memory map. it is particularly important to set-up the memory map. in the hitachi embedded workshop the project
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 14 of 61 generation process will have completed much of this work. however if you are using a different configuration of board from the standard types then some customization will be essential. 2.3.1 mapping for the debugger to correctly represent your user system, the memory map must be set up. it needs to know which areas in the device's address space are ram, rom, on-chip registers or areas where there is no memory. when you select the device type and mode in the project generator, the hew will automatically set up the map for that device and the mode in which the processor is operating. for example in a device with internal rom and ram, the areas where these are located in the device's memory map will be set by default. if you are using a device that does not have internal memory, or a device with external memory instead of, or in addition to, the internal memory, then you must tell the debugging platform that you have memory there. when using the simulator, the memory map settings can be modified in the simulator system dialog box. for details, refer to the manual for the debugging platform. in this case, the settings can be referred to in the simulator pane of the standard toolchain dialog box. clicking the view button of the standard toolchain dialog box (figure 2.4) displays the cpu hardware map dialog box (figure 2.5). figure 2.4: standard toolchain dialog
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 15 of 61 figure 2.5: cpu hardware map dialog the following information is displayed: [operation] displays the address range [memory view] displays memory map and memory resource information 2.3.2 memory resource to use the simulator, the memory resource of the address range being used must be saved. the memory resource settings can be modified in the simulator memory resource dialog box. for details, refer to the manual for the debugging platform. in this case, the settings can be referred to in the simulator pane of the standard toolchain dialog box (figure 2.6). the simulator pane contains the following buttons: [view] displays the memory map information [add] adds memory resource [modify] modifies the selected memory resource [remove] removes the selected memory resource clicking the add button displays the add memory resource dialog box (figure 2.7).
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 16 of 61 figure 2.7: add memory resource dialog specify the following three items in the add memory resource dialog box: [start] start address [end] end address [attribute] attributes (r: read only, r/w: readable/writable) modification of the memory resource information in the simulator memory resource dialog box will be reflected in the contents of the standard toolchain dialog box, and modification in the standard toolchain dialog box will be reflected in the contents of the simulator memory resource dialog box as well. 2.3.3 downloading a program once you have made sure that there is memory in your system in which to download your code, you can then proceed to download a program to debug. the initial selection of download module is automatic with regard to an application generator, as it is the output from the linker. however with regard to the debug only project generator it is possible for you to select the module which you wish to download. it is also possible to manually choose download modules after the project creation. this is achieved via the debug settings dialog shown in figure 2.9. this dialog allows you to control the debug settings throughout your workspace. the tree on the left of the dialog contains all of the current projects. selecting a project in this tree will then show you the settings for that project and the session selection in the session drop list. it is possible to select multiple sessions in this list box or all sessions. if you select multiple sessions you can choose to modify the settings for one or more sessions at once. the debug settings dialog displays the following debug options: current debug target for the current project and session selection. download modules for the current project and session selection. the download module list displays the order in which the files will be downloaded to the target. it is possible to add, remove, modify, move up and move down modules in this list. to add a new download module: 1. select [options->debug settings] . the dialog shown in figure 2.9 will be displayed. 2. select the project and configurations you are interested in adding a download module to in the tree control. 3. click the add button. the dialog displayed in figure 2.8 is displayed. 4. the format list box contains a list of supported object format readers. this allows you to choose the correct reader for the download module you wish to add to the project.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 17 of 61 5. the file name field allows you to browse to the download module on your disk, or simply type it into the edit control if you have not yet built the module. 6. enter an offset address to the offset address field (suitable only for some object formats). 7. when the user clicks add the debug download module is added to the bottom of the list. if you wish to position the module in a different position in relation to the other modules, select the module and then use the move up and move down buttons to position the module correctly. figure 2.8: download module dialog figure 2.9: debug settings dialog (target pane) any changes made in the debug settings dialog are only changed when you click the ok button. if the download modules are changed for the current target then the modules are flagged for download next time the program is run for debug. the default debug format is set to the first download module in the list by default. it is only possible to specify one default debug object format per session. all currently installed debugger formats are listed here.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 18 of 61 figure 2.10: debug settings dialog (options pane) the options page of the debug settings dialog contains the option which determines when a target is connected. if the options are checked then the target is not connected until you select [build->debug->go] . if the option is unchecked then the target is connected whenever a configuration is opened. this happens when a new workspace or project is opened and also when you switch configuration using the toolbar or configurations dialog. the command line batch-processing list contains a list of command line batch commands. these batch commands can perform debug operations via the command line. it is possible to choose when these are executed in the timing drop list. each drop list selection has a different list of batch files. so choosing a selection in the timing drop list alters which command line batch files you can see. the order in the list is the order the command line batch files will be executed when the timing event occurs. 2.3.4 manual download of modules once you have decided which download modules are to be download to the target it is possible to manually update the modules on the connected target. this is achieved by selecting [debug -> download modules] . this allows a single module or all of the modules to be downloaded. this can also be achieved by right clicking on a module in the workspace window under the download module folder. 2.3.5 automatic download of modules when you select [debug->run] the hew calculates whether any of the file times or debugger settings, which affect the modules, have changed since the last download. if the hew detects a change then it asks the user whether a download needs to take place for each module. if the user selects yes then the modules are downloaded to the target. if you have banked multiple modules at the same start address then by default only the first module at that address is downloaded. it is then possible to manually load and unload the other modules in the list whenever you want from the [debug -> download modules] and the [debug -> unload modules] menu items.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 19 of 61 2.3.6 unload modules it is then possible to manually unload downloaded modules in the list whenever you want from the [debug -> unload modules] menu item. this feature can also be accessed from the download module pop-up in the workspace window. when a module is unloaded its symbols are lost from the hew debugging system. although the target remains unmodified. it will no longer be possible to debug this module once it is unloaded.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 20 of 61 2.3.7 looking at registers if you are debugging at assembly-language level, then you will probably find it useful to see the contents of the cpu's general registers. you can do this using the registers window. figure 2.11: registers window to open a registers window choose [view->r egisters] or click the register window toolbar button [ ]. a registers window opens showing all of the cpu's general registers and the values, displayed in hexadecimal. 2.3.8 expanding a bit register if a register is used as a set of flags at the bit level for the control of state, its one-character name rather than its state indicate each bit. double-click on the registers name to display the edit register dialog box and switch each bit on or off. checking the checkbox for any bit specifies it as holding a 1, while removing the check specifies it as a 0.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 21 of 61 figure 2.12: expanding a flag register to collapse an expanded flag register, double click on the minus sign. the flags collapse back to the single item and the minus sign changes back to a plus sign. 2.3.9 modifying register contents to change a register's contents open the edit register dialog box in one of these methods: 1. double-click the register you want to change. 2. select the register you want to change, and press enter . 3. select the register you want to change, and choose [edit] from the popup menu. figure 2.13: register dialog box as in any other data entry field in hew 2.1, you can enter a formatted number or c/c++ expression. you can choose whether to modify the whole register contents, a masked area, floating or flag bits by selecting an option from the drop list box (the contents of this list depend on the cpu model and selected register). when you have entered the new number or expression, click the ok button or press the enter key, the dialog box closes and the new value is written into the register.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 22 of 61 2.3.10 using register contents use the value contained in a cpu register by specifying the register name prefixed by the # character, e.g.: #r1, #pc, #r6l, or #er3 when you are entering a value elsewhere in the hew, for example when displaying a specified address in the disassembly or memory windows.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 23 of 61 3. looking at your program this section describes how to look at your program as source code and assembly language mnemonics. the hew has various facilities for dealing with code and symbol information which are explained in this section and you will be shown how to look at text files in the user interface. note: after a break occurs the hew displays the location of the program counter (pc). in some cases, for example if a sysrof based project is moved from its original path, then the source files may not be automatically found. in this case the hew will open a source file browser dialog to allow you to manually locate the file - this path will then be used to update any other source files in this debug project. 3.1 viewing the code select your source file and click the open button, the hew opens the file in the integrated editor. it is also possible to view your source files by double clicking on them in the workspace window. figure 3.1: source window the editor is divided into two areas: the gutter area (containing markers for breakpoints, pc location, etc.) and the text area (containing color syntax highlighted code). this is shown above in figure 3.1. 3.2 viewing assembly-language code if you have a source file open, right-click to open the popup menu and select [view disassembly] to open a disassembly window at the same address as the current source window. if you do not have a source file, but wish to view code at assembly-language level, either choose [view- >disassembly] ; use the ctrl+d accelerator; or click on the disassembly window toolbar button [ ]. the disassembly window opens at the current pc location, and shows address and code (optional) - showing the disassembled mnemonics (with labels when available). optionally, any source line starting at that address may be shown, thus providing mixed mode display.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 24 of 61 figure 3.2: disassembly window 3.3 modifying assembly-language code you can modify the assembly-language code by double clicking on the instruction that you wish to change. the assembler dialog box will open: figure 3.3: assembler dialog box the address, machine code and disassembled instruction are displayed. type the new instruction or edit the old instruction in the mnemonics field. pressing the enter key will assemble the instruction into memory and move on to the next instruction. clicking ok will assemble the instruction into memory and close the dialog box. clicking the cancel button or pressing the esc key will close the dialog box. note: the assembly-language display is disassembled from the actual machine code in the debugging platform's memory. if the memory contents are changed the dialog box (and disassembly window) will show the new assembly-language code, but the source window will be unchanged. this is true even if the source file contains assembler.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 25 of 61 3.4 looking at labels in addition to the debugging information that the hew uses to link your program's source code to the actual code in memory, the debug object file also contains symbolic information. this is a table of text names that represent an address in the program and is referred to as labels in hew. in the disassembly window, you will see the first 8 characters of the label in place of the corresponding address, and as part of an instruction's operand. note: an instruction's operand is replaced with a label name if the operand and label value match. if two or more labels have the same value, then the label that comes first alphabetically will be displayed. tip : wherever you can enter an address or values in an edit control you can use a label instead. 3.5 l isting labels to see a list of all the labels defined in the current debugger session select [view->labels] . figure 3.4: labels window you can view symbols sorted either alphabetically (by ascii code) or by address value by clicking on the respective column heading. you can quickly toggle a software break at the entry point of a function by double-clicking in the bp column. alternatively, right-click to show the popup menu and select [break] .
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 26 of 61 3.6 looking at a specific address when you are looking at your program in a disassembly window, you may want to look at another area of your program's code. rather than scrolling through a lot of code in the program, you can go directly to a specific address. select [set address] from the popup menu, and the dialog shown in figure 3.5 is displayed. figure 3.5: set address dialog box enter the address or label name in the edit box and either click on ok or press the enter key. the disassembly window updates to show the code at the new address. when an overloaded function or a class name is entered, the select function dialog box opens for you to select a function. this is detailed in section 7, elf/dwarf2 support of this manual. 3.7 looking at the current program counter address wherever you can enter an address or value into the hew, you can also enter an expression. if you enter a register name prefixed by the hash character, the contents of that register will be used as the value in the expression. therefore if you open the set address dialog box and enter the expression "#pc", the source or disassembly window display will go to the current pc address. it also allows that you can display from an offset of the current pc by entering an expression with the pc register plus an offset, e.g., "#pc+0x100". 3.8 source address column once your program has downloaded the source window updates and displays any addresses for the current source file. these are shown on the left-hand side of the source window. this feature is useful for deciding where you can set pc or hardware breakpoints. this is show below in figure 3.6.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 27 of 61 figure 3.6: source window and address column to switch off a column in all source files: 1. right click on the editor window. 2. click the define column format menu item. 3. the global editor column states dialog is displayed. 4. the check status shows whether the column is enabled or not. if it is checked it is enabled if the check box is gray this means that in some files the column is enabled and in other files it is not. 5. click ok for the new column settings to take effect. to switch off a column in one source files: 1. right click on the editor window, which you wish to remove a column from, and the editor pop-up is displayed. 2. click the columns menu item and a cascaded menu item appears. each column is displayed in this pop-up menu. if the column is enabled it has a tick next to its name. clicking the entry will toggle whether the column is displayed or not.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 28 of 61 figure 3.7: global column state dialog box 3.9 debugger columns any component can add columns to both the disassembly and source windows. this can change the look and feel of your hitachi embedded workshop environment but very much depends on the installation you are running. typical examples of columns are the coverage column, which graphically displays code coverage during debugger execution. another example is the target component column, this can show the hardware breakpoints set to the target. right clicking on the column displays the respective pop-up menu for that column. this is different for every column and is managed by the individual component. double clicking on the column also has a different effect depending on the column. for example in the editor and target column this sets a pc or hardware breakpoint.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 29 of 61 4. working with memory this section describes how to look at areas of memory in the cpu's address space. it will show you how to look at an area of memory in different formats, fill, move and test a block of memory, and save, load and verify an area of memory with a disk file. 4.1 looking at an area of memory to look at an area of memory, choose [view->m emory] ; using the ctrl+m accelerator; or clicking the memory window toolbar button [ ] to open a memory window. this will launch a set address dialog box shown in figure 4.1. figure 4.1: set address dialog box type in the start address or equivalent symbol for the address you want to see in the address field. click ok or press the enter key, and the dialog box closes and a memory window opens: figure 4.2: memory window
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 30 of 61 there are three display columns: 1. address - the address of the first item in the data column of this row. 2. data - the data read from the debugging platform's physical memory at the access width and then converted to the displayed width. 3. value - data displayed in an alternative format. 4.2 displaying data in different formats if you want to change the display format from the one you selected when you opened the view, selecting [format] from the popup menu can do this. this dialog is displayed in figure 4.3. figure 4.3: format memory display dialog box to display and edit memory in different widths, use the display data as drop list - for example, choose the byte option and the display will be updated to show the area of memory as individual bytes. the data can be interpreted into different formats - this is shown in the third column, value. the list of formats depends on the data selection. the font of the value column can be different from the font used to display the data. this is useful for displaying double-byte character values when the data is displayed in word format. the selection will use the same font in the value column as the rest of the window. 4.3 looking at a different area of memory if you want to change the area of memory that the memory window is displaying you can use the scroll bars. to quickly look at a new address you can use the set address dialog box. this can be opened either be choosing [start address] from the popup menu or by double-clicking in the address column. enter the new address value, and click ok or press the enter key. the dialog box closes and the memory window display is updated with the data at the new addre ss. when an overloaded function or a class name is entered, the select function dialog box opens for you to select a function.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 31 of 61 4.4 modifying memory contents to change the contents of memory is accessed via the edit dialog box. move the cursor on the memory unit (depending on your memory window display choice) that you wish to change. either double-click on the memory unit, or press the enter key. the dialog in figure 4.4 is displayed. figure 4.4: edit memory dialog box like any other data entry field in hew, you can enter a formatted number or c/c++ expression. when you have entered the new number or expression, click the ok button or press the enter key, the dialog box closes and the new value is written into memory. 4.4.1 selecting a memory range if the memory address range is in the memory window, you can select the range by clicking on the first memory unit (depending on your memory window display choice) and dragging the mouse to the last unit. the selected range is highlighted. if the memory address range is larger than or outside the memory window, then you can enter the start addresses and byte count in the respective fields of the memory dialog boxes. 4.4.2 finding a value in memory to find a value in memory you must open a memory view, then choose [search] from the popup menu. alternatively, with a memory window in focus, just press f3 . the search memory dialog box is displayed as shown in figure 4.5. figure 4.5: search memory dialog box
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 32 of 61 enter the start and end addresses of the range in which to search (if an area of memory was selected in the memory window then the begin and end address values will be filled in automatically) and the data value to search for. the end address can also be prefixed by a '+' which will use the entered value as a range. select the search format (defaults to data display format) and click ok or press the enter key. the dialog closes and the hew searches the range for the specified data. if the data is found, it will be highlighted in the memory window, and a message showing the address at which the data has been found is displayed on the status bar. if the data cannot be found, the caret position in the memory window remains unchanged and a message informing you that the data could not be found is displayed on the status bar. 4.5 filling an area of memory with a value you can set the contents of a range of memory addresses to a value using the memory fill feature. 4.5.1 filling a range to fill a range of memory with the same value, choose [fill] on a memory window's popup menu, or on the memory drop-down menu. the fill memory dialog box and is shown in figure 4.6. figure 4.6: fill memory dialog box if an address range has been selected in the memory view, the specified start and end address will be displayed. select the format from the format drop list and enter the data value in the data field. click the ok button or press the enter key, the dialog box closes and the new value is written into the memory range.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 33 of 61 4.6 copying an area of memory you can copy an area of memory using the memory copy feature. select a memory range and then choose [copy] from the popup menu. the copy memory dialog box opens: figure 4.7: copy memory dialog box the source start address and end address specified in the memory window will be displayed in the begin and end fields. enter the destination start address in the destination field and click the ok button or press the enter key, the dialog box closes and the memory block will be copied to the new address. 4.7 testing an area of memory note : the exact test is target dependent. however, in all cases the current contents of the memory will be overwritten - your program or data will be erased. the test memory function is not supported by some debugging platforms. you can test an area of memory in the address space using the memory test feature. select a memory and choose [test] from the popup menu. the test memory dialog box is displayed as shown in figure 4.8. figure 4.8: test memory dialog box the start address and end address specified in the memory view will be displayed in the begin and e nd fields. click the ok button or press the enter key, the dialog box closes and the hew will perform a test on the memory range.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 34 of 61 4.8 saving and verifying an area of memory you can save an area of memory in the address space to a disk file using the save memory feature. open the save memory as dialog box by choosing [file->s ave memory...] : figure 4.9: save memory as dialog box enter the start and end addresses of the memory block that you wish to save, and a name and format for the file. the file name drop-list contains the previous four file names used for saving memory, or clicking the browse button can launch a standard file save as dialog. click the ok button or press the enter key, the dialog box closes and the memory block will be saved to the disk as a motorola s-record format file. when the file save is complete a confirmation message box may be displayed. you can verify an area of memory in the address space using the verify memory feature. open the verify memory dialog box by choosing [file->v erify memory...] : figure 4.10: verify memory dialog box 4.9 looking at i/o memory as well as a cpu and rom/ram, a micro-controller also contains on-chip peripheral modules. the exact number and type of peripheral modules differ between devices but typical modules are dma controllers, serial
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 35 of 61 communications interfaces, a/d converters, integrated timer units, a bus state controller and a watchdog timer. accessing registers, which are mapped to the micro-controllers address space, programs the on-chip peripherals. the memory window only allows you to look at data in memory as byte, word, long word, single-precision floating-point, double precision floating-point, or ascii values, so hew also provides an io window to ease inspection and setting up of these registers. 4.9.1 opening an io window to open an io window select [view->i o] or click the io window toolbar button [ ]. modules that match the on-chip peripherals organize the i/o register information. when an io window is first opened, only a list of module names is displayed. figure 4.11: io window 4.9.2 expanding an i/o register display to display the names, addresses and values of the i/o registers, double click on the module name or select the module name, by clicking on it or using the cursor keys, and press the enter key. the module display will expand to show the individual registers of that peripheral module and their names, addresses and values. double clicking (or pressing the enter key) again on the module name will close the i/o register display. to display to bit level, expand the i/o register in a similar way. the bits are color coded as follows: black normal read/write red value changed grey peripheral disabled (by peripheral control registers) 4.9.3 modifying i/o register contents to edit the value in an i/o register you can type hex values directly into the window. to enter more complex expressions double click or press the enter key on the register to open a dialog box to modify the register contents. when you have entered the new number or expression, click the ok button or press the enter key; the dialog box closes and the new value is written into the register.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 36 of 61
hitachi embedded workshop user manual rev. 2.0, 06/02, 37 of 61 5. executing your program this section describes how you can execute your program's code. you will learn how to do this by either running your program continuously or stepping single or multiple instructions at a time. 5.1 running from reset to reset your user system and run your program from the reset vector address choose [debug->re set go] , or click the reset go toolbar button [ ]. the program will run until it hits a breakpoint or a break condition is met. you can stop the program manually at any time by choosing [debug->h alt] , or by clicking the halt toolbar button [ ]. note: the program will start running from whatever address is stored in the reset vector location. therefore it is important to make sure that this location contains the address of your startup code. 5.2 continuing run when your program is stopped and the debugger is in break mode , the hew will display an yellow arrow mark in the gutter of the line in the editor and disassembly windows that correspond to the cpu's current program counter (pc) address value. this will be the next instruction to be executed if you perform a step or continue running. to continue running from the current pc address click the continue toolbar button [ ], or choose [debug- >go] . 5.3 running to the cursor sometimes as you are going through your application you may want to run only a small section of code, that would require many single steps to execute. you can do this using the go to cursor feature. how to use the go to cursor 1. make sure that a source or disassembly window is open showing the address at which you wish to stop. 2. position the text cursor on the address at which you wish to stop by either clicking in the address field or using the cursor keys. 3. choose [go to cursor] from the popup menu. the debugging platform will run your code from the current pc value until it reaches the address indicated by the cursor's position. notes 1. if your program never executes the code at this address, the program will not stop. if this happens, code execution can be stopped by pressing the esc key, choosing [debug->h alt] , or clicking on the stop toolbar button [ ]. 2. the go to cursor feature requires a temporary breakpoint - if you have already used all those available then the feature will not work, and the menu option will be disabled. 5.4 single step to debug your code it is very useful to be able to step a single line or instruction at a time and examine the effect of that instruction on the system. in the source window, then a step operation will step a single source line. in
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 38 of 61 the disassembly window, a step operation will step a single assembly-language instruction. if the instruction calls another function or subroutine, you have the option to either step into or step over the function. if the instruction does not perform a call, then either option will cause the debugger to execute the instruction and stop at the next instruction. 5.4.1 stepping into a function if you choose to step into the function the debugger will execute the call and stop at the first line or instruction of the function. to step into the function either click the step in toolbar button [ ], or choose [debug->s tep in] . 5.4.2 stepping over a function call if you choose to step over the function the debugger will execute the call and all of the code in the function (and any function calls that that function may make) and stop at the next line or instruction of the calling function. to step over the function either click the step over toolbar button [ ], or choose [debug->step ov er] . 5.4.3 stepping out of a function there are occasions when you may have entered a function, finished stepping through the instructions that you want to examine and would like to return to the calling function without tediously stepping through all the remaining code in the function. or alternatively you may have stepped into a function by accident, when you meant to step over it and so want to return to the calling function without stepping all the way through the current function. you can do this with the step out feature. to step out of the current function either click the step out toolbar button [ ], or choose [debug->step o ut] .
hitachi embedded workshop user manual rev. 2.0, 06/02, 39 of 61 5.5 multiple steps you can step several instructions at a time by using the step program dialog box. the dialog box also provides an automated step with a selectable delay between steps. open it by choosing [debug-> st ep...] . the step program dialog box is displayed: figure 5.1: step program dialog box enter the number of steps in the steps field and select whether you want to step over function calls by the step over calls check box. if you are using the feature for automated stepping, select the step rate from the list in the rate field. click ok or press enter to start stepping.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 40 of 61
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 41 of 61 6. stopping your program this section describes how you can halt execution of your application's code. this section describes how to do this directly by using the halt command and by setting breakpoints at specific locations in your code. 6.1 halting execution when your program is running, the halt toolbar button is enabled [ ] (a red stop sign), and when the program has stopped it is disabled [ ] (the stop sign is grayed out). to stop the program click on the halt toolbar button, or choose [debug->h alt] . the last break cause can also be viewed in the debug pane of the output window. 6.2 standard breakpoints (pc breakpoints) when you are trying to debug your program you will want to be able to stop the program running when it reaches a specific point or points in your code. you can do this by setting a pc breakpoint on the line or instruction at which to want the execution to stop. the following instructions will show you how to quickly set and clear simple pc breakpoints. if more complex breakpoint operation is supported by the target, it may provide a breakpoints window. to set a program (pc) breakpoint 1. make sure that the disassemble or a source window is open at the place you want to set a (pc) breakpoint. 2. select [toggle breakpoint] from the pop-up menu, or press f9 , at the line showing the address at which you want the program to stop. you can also double click in the source gutter to set a (pc) breakpoint. 3. you will see a red circle appear in the gutter to indicate that a (pc) breakpoint has been set. 4. it is also possible to add, remove and edit the current breakpoint set up by using [edit->breakpoints] . now when you run your program and it reaches the address at which you set the (pc) breakpoint, execution halts with the message "break = pc break" displayed in the debug pane of the output window, and the source or disassembly window is updated with the program (pc) breakpoint line highlighted. note : the line or instruction at which you set a program (pc) breakpoint is not actually executed; the program stops just before it is about to execute it. if you choose to go or step after stopping at the (pc) breakpoint, then the highlighted line will be the next instruction to be executed.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 42 of 61 6.2.1 using the breakpoint dialog box the breakpoint dialog box is displayed in figure 6.1. it allows you to view the current breakpoints set in the workspace and view the code associated with each. from this dialog box it is also possible to remove one or all breakpoints. figure 6.1: breakpoints dialog box 6.2.2 toggling pc breakpoints it is possible to toggle pc breakpoints by either double clicking in the bp column of the line at which the (pc) breakpoint is set or placing the cursor on the line and using the f9 key. the display will cycle through the available standard breakpoint types - a colored circle will be shown in the gutter.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 43 of 61 7. elf/dwarf2 support the hew supports the elf/dwarf2 object file format for debugging applications written in c/c++ and assembly language for hitachi microcomputers. it provides a powerful way of accessing, observing and modifying the symbolic level debugging information about the user application that is running. key features source level debugging c/c++ operators c/c++ expression (casting, pointers, references, etc.) ambiguous function names overlay memory loading watch - locals, and user defined. stack trace 7.1 c/c++ operators the c/c++ language operators are available: +, -, *, /, &, |, ^, ~, !, >>, <<, %, (, ), <, >, <=, >=, ==, !=, &&, || buffer_start + 0x1000 #r1 | b ' 10001101 ((pointer + (2 * increment_size)) & h ' ffff0000) >> d ' 15 !(flag ^ #er4) 7.2 c/c++ expressions expression examples object.value //specifies direct reference of a member (c/c++) p_object->value //specifies indirect reference of a member (c/c++) class::value //specifies reference of a member with class (c++) *value //specifies a pointer (c/c++) &value //specifies a reference (c/c++) array[0] //specifies an array (c/c++) object.*value //specifies reference of a member with pointer (c++) ::g_value //specifies reference of a global variable (c/c++) class::function(short) //specifies a member function (c++) (struct str) *value //specifies cast operation (c/c++)
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, page 44 of 61 7.3 supporting duplicate labels in some languages, for example c++ overloaded functions, a label may represent more than one address. when such a label name is entered in a dialog box, the hew will display the select function dialog box to display overloaded functions and member functions. figure 7.1: select function dialog box select overloaded functions or member functions in the select function dialog box. generally, one function can be selected at one time; only for setting breakpoints, multiple functions can be selected. this dialog box has three areas. select function name list box displays the same-name functions or member functions and their detailed information. set function name list box displays the function to be set and their detailed information. counter group edit box all function displays the number of same-name functions or member functions. select function displays the number of functions displayed in the select function name list box. set function displays the number of functions displayed in the set function name list box. 7.4 selecting a function click the function you wish to select in the select function name list box, and click the > button. you will see the selected function in the set function name list box. to select all functions in the select function name list box, click the >> button. 7.5 deselecting a function click the function you wish to deselect from the set function name list box, and click the < button. to deselect all functions, click the << button. the deselected function(s) will be moved from set function name list box back to the select function name list box.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 45 of 61 7.6 setting a function click the ok button to set the functions displayed in the set function name list box. the functions are set and the select function dialog box closes. clicking the cancel button closes the dialog box without setting the functions. 7.7 overlay function programs making use of the overlay function can be debugged. this section explains the settings for using the overlay function. 7.8 displaying section group when the overlay function is used, that is, when several section groups are assigned to the same address range, the address ranges and section groups are displayed in the overlay dialog box. open the overlay dialog box by choosing [memory->configure ov erlay] . figure 7.2: overlay dialog box (at opening) this dialog box has two areas: the address list box and the s ection name list box. the address list box displays the address ranges used by the overlay function. click to select one of the address ranges in the address list box. figure 7.3: overlay dialog box (address range selected)
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, page 46 of 61 the section name list box displays the section groups assigned to the selected address range. setting section group when using the overlay function, the highest-priority section group must be selected in the overlay dialog box; otherwise hew will operate incorrectly. first click one of the address ranges displayed in the address list box. the section groups assigned to the selected address range will then be displayed in the section name list box. click to select the section group with the highest-priority among the displayed section groups. figure 7.4: overlay dialog box (highest-priority section group selected) after selecting a section group, clicking the ok button stores the priority setting and closes the dialog box. clicking the cancel button closes the dialog box without storing the priority setting. note : within the address range used by the overlay function, the debugging information for the section specified in the overlay dialog box is referred to. therefore, the same section of the currently loaded program must be selected in the overlay dialog box. 7.9 tooltip watch the quickest way to look at a variable in your program is to use the tooltip watch feature. to use tooltip watch: open the source window showing the variable that you want to examine. rest the mouse cursor over the variable name that you want to examine - a tooltip will appear near the variable containing basic watch information for that variable. figure 7.5: locals view
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 47 of 61 7.10 local variables to look at local variables, open the locals window by choosing [view->l ocals] . the locals window opens: figure 7.6: locals window as you debug your program the locals window will be updated. if a local variable is not initialized when defined, then the value in the locals window will be undefined until a value is assigned to the local variable. the local variable values and the radix for local variable display can be modified in the same manner as in the watch window.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, page 48 of 61 7.11 watch items hew allows you to open watch windows, which contain a list of variables and their values. to open a watch window choose [view->w atch] ; or click on the watch window toolbar button [ ] if it is visible. a watch window opens. initially the contents of the window will be blank. 7.11.1 adding a watch use the add watch dialog box in the watch window to add watch items to the watch window. to use add watch from a watch view: open the watch view. choose [add watch] from the popup menu. the add watch dialog box opens: figure 7.7: add watch dialog box enter the name of the variable that you wish to watch and click ok . the variable is added to the watch window. figure 7.8: watch window note : if the variable that you have added is a local variable that is not currently in scope, hew will add it to the watch window but its value will be blank, or set to a question mark, '?'. 7.11.2 expanding a watch if a watch item is a pointer, array, or structure, then you will see a plus sign (+) expansion indicator to left of its name, t his means that you can expand the watch item. to expand a watch item, double click on it. the item expands to show the elements (in the case of structures and arrays) or data value (in the case of pointers) indented by one tab stop, and the plus sign changes to a minus sign (-). if the elements of the watch item also contain pointers, structures, or arrays then they will also have expansion indicators next to them.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 49 of 61 figure 7.9: expanding a watch to collapse an expanded watch item, double click on the item again. the item's elements will collapse back to the single item and the minus sign changes back to a plus sign. 7.11.3 editing a watch item's value you may wish to change the value of a watch variable, e.g. for testing purposes or if the value is incorrect due to a bug in your program. to change a watch item's value use the edit value function. editing a watch item's value: select the item to edit by clicking on it, you will see a flashing cursor on the item. choose [edit value] from the popup menu. the edit value dialog box opens: figure 7.10: edit value dialog box enter the new value or expression in the new value field and click ok . the watch window is updated to show the new value. deleting a watch to delete a watch item, select it and choose [delete] from the popup menu. the item is deleted and the watch window updated.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, page 50 of 61
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 51 of 61 8. viewing the profile information the profile function enables function-by-function measurement of the performance of the application program in execution. this makes it possible to identify parts of an application program that degrade its performance and the reasons for such degradation. hew displays the results of measurement in three windows, according to the method and purpose of viewing the profile data. 8.1 stack information files the profile function allows the hew to read the stack information files (extension: .sni ) which are output by the hitachi optimizing linker (ver. 7.0 or later). each of these files contains information related to the calling of static functions in the corresponding source file. reading the stack information file makes it possible for the hew to display this information to do with the calling of functions without executing the user application (i.e. before measuring the profile data). however, this feature is not available when [setting->only executed functions] is checked in the popup menu of the profile window. when the hew does not read any stack information files, the data about the functions executed during measurement will be displayed by the profile function. to make the linker create a stack information file, select other from the category: list box and check the stack information output box in the link/library pane of the standard toolchain dialog box. figure 8.1: standard toolchain dialog box (1)
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, page 52 of 61 8.2 profile information files to create a profile information file, select the output profile information files menu option from the pop-up menu of the profile window and specify the file name, after measuring a profile data of the application program. this file contains information on the number of times functions are called and global variables are accessed. the hitachi optimizing linker (ver. 7.0 or later) is capable of reading the profile information file and optimizing the allocation of functions and variables in correspondence with the status of the actual operation of the program. to input the profiler information file to the linker, select optimize from the category: list box and check the include profile: box in the link/library pane of the standard toolchain dialog box, and specify the name of the profile information file. figure 8.2: standard toolchain dialog box (2) to enable the settings in the include profile: box, specify the optimize list box as some setting other than none.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 53 of 61 8.3 loading stack information files you can select whether or not to read the stack information file in a message box for confirmation that is displayed when a load module is loaded. clicking the ok button of the message box loads the stack information file. the message box for confirmation will be displayed when: there are stack information files (extension: * .sni ) the load stack information files (sni files) check box is checked in the confirmation pane of the options dialog box (figure 8.3) that can be opened by selecting [tools->options] from the main menu figure 8.3: options dialog box
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, page 54 of 61 8.4 enabling the profile select [view->profile] to open the profile window. select enable profiler from the pop-up menu of the profile window. the item on the menu will be checked. 8.5 specifying the measurement for profiling you can specify whether to trace function calls or not. if you choose to trace them, their relationship among function calls is shown in the tree structure. if not, it not available, but it takes less time in measurement. when you do not trace the function calls, select disable tree (not traces function call) from popup. if a function call is not used in a normal way (e.g. task switching of the os), the profile view may bi displayed incorrectly. in this case, do not trace function calls and just measure the profile. 8.6 executing the program and checking the results after the user program has been executed and execution has been halted, the results of measurement are displayed in the profile window. the profile window has two tabs; a list tab and a tree tab. 8.6.1 list tab this tab lists functions and global variables and displays the profile data for each function and variable. figure 8.4: list tab 8.6.2 tree tab this tab displays the relation of function calls as a tree diagram along with the profile data that are values when the function is called.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 55 of 61 figure 8.5: tree tab 8.6.3 profile-chart window the profile-chart window displays the relation of calls for a specific function. this window displays the specified function in the middle, with the callers of the function on the left and the callees of the function on the right. the numbers of times the function calls the called functions or is called by the calling functions are also displayed in this window. figure 8.6: profile-chart window 8.7 types and purposes of displayed data the profile function is able to acquire the following information: address you can see the locations in memory to which the functions are allocated. sorting the list of functions and global variables in order of their addresses allows the user to view the way the items are allocated in the memory space. size sorting in order of size makes it easy to find small functions that are frequently called. setting such functions as inline may reduce the overhead of function calls. if you are using a microcomputer which incorporates a cache memory, more of the cache memory will need to be updated when you execute larger functions. this information allows you to check if those functions that may cause cache misses are frequently called.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, page 56 of 61 stack size when there is deep nesting of function calls, pursue the route of the function calls and obtain the total stack size for all of the functions on that route to estimate the amount of stack being used. times sorting by the number of calls or accesses makes it easy to identify the frequently called functions and frequently accessed global variables. others measurement of a variety of target-specific data is also available. for details, refer to the simulator or emulator manual for the target platform that you are using.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 57 of 61 8.8 creating profile information files to create a profile information file, select the output profile information files menu option from the pop-up menu. the save profile information files dialog box is displayed. pressing the save button after selecting a file name will write the profile information to the selected file. pressing the save all button will write the profile information to all of the profile information files. figure 8.7: save profile information files dialog box 8.9 notes 1. the number of executed cycles for an application program as measured by the profile function includes a margin of error. the profile function only allows the measurement of the proportions of execution time that the functions occupy in the overall execution of the application program. use the performance analysis function to precisely measure the numbers of executed cycles. 2. the names of the corresponding functions may not be displayed when the profile information on a load module with no debug information is measured. 3. the stack information file (extension: .sni ) must be in the same directory as the load module file (extension: .abs ). 4. it is not possible to store the results of measurement. 5. it is not possible to store the results of measurement.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, page 58 of 61
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 59 of 61 appendix a - i/o file format hew formats the io window based on information it finds in an i/o register definition file. when you select a debugging platform, hew will look for a .io file corresponding to the selected device and load it if it exists. this file is a formatted text file that describes the i/o modules and the address and size of their registers. you can edit this file, with a text editor, to add support for memory mapped registers or peripherals you may have specific to your application e.g. registers in an asic device mapped into the microcomputer's address space. a.1 file format each module name must be defined in the [modules] definition section and the numbering of each module must be sequential. each module corresponds to a register definition section and within the section each entry defines an i/o register. the 'baseaddress' definition is for devices where the location of i/o registers moves in the address space depending on the cpu mode. in this case, the 'baseaddress' value is the base address of the i/o registers in one specific mode and the addresses used in the register definitions are the address locations of the registers in the same mode. when the i/o register file is actually used, the 'baseaddress' value is subtracted from the defined register address and the resultant offset added to the relevant base address for the selected mode. each module has a section that defines the registers forming it along with an optional dependency, the dependency is checked to see if the module is enabled or not. each register name must be defined in the section and the numbering of each register must be sequential. the dependency is entered in the section as dep= . 1. is the register id of the dependency. 2. is the bit position within the register. 3. is the value that the bit must be for the module to be enabled. the [register] definition entry is entered in the format id=
[ [[[]]]]. 1. register name to be displayed. 2.
address of the register. 3. which may be b, w or l for byte, word, or long word (default is byte). 4. which can be set to a if the register is at an absolute address. this is only relevant if the i/o area address range moves about on the cpu in different modes. in this case, if a register is defined as absolute the base address offset calculation is not performed and the specified address is used directly. 5. format for register output. valid values are h for hexadecimal, d for decimal, and b for binary. 6. section defining the bits within the register. bitfield sections define the bits within a register each entry is of the type bit=. 1. is the bit number. 2. is a symbolic name of the bit. comment lines are allowed and must start with a ; character.
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, page 60 of 61
hitachi embedded workshop debugger user manual rev. 2.0, 06/02, 61 of 61 appendix b - symbol file format in order for hew to be able to understand and decode the symbol file correctly, the file must be formatted as a pentica-b file: 1. the file must be a plain ascii text file. 2. the file must start with the word begin. 3. each symbol must be on a separate line with the value first, in hexadecimal terminated by an h, followed by a space then the symbol text. 4. the file must end with the word end. example: begin 11fah symbol_name_1 11fch symbol_name_2 11feh symbol_name_3 1200h symbol_name_4 end


▲Up To Search▲   

 
Price & Availability of HD6413001

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X